package com.itheima.chapter08.collection;

import java.util.ArrayList;

//增强for
public class demo3 {
    public static void main(String[] args) {
        ArrayList<String> list =new ArrayList<>();
        list.add("a");
        list.add("b");
        list.add("c");
        list.add("e.txt");
        for (String s : list) {
            System.out.print(s+" ");
            s="q";
            //s仅仅是一个第三方变量，与原集合不干扰
            System.out.println(s);
        }
        System.out.println(list);
    }
}
